#include "thread_pool.hpp"
#include "Task.hpp"
#include <iostream>
#include <ctime>
#include <unistd.h>

using namespace std;
// 先做出使用线程池的框架
int main()
{
    srand(time(nullptr) ^ getpid());
    thread_pool<task> tp;
    tp.start();
    size_t len = operaters.size();
    while(true)
    {
        int data1 = rand() % 10 + 1;
        int data2 = rand() % 10;
        char op = operaters[rand() % len];
        task t(data1, data2, op);
        printf("产生了一个任务：%s\n", t.get_task().c_str());
        tp.push(t);
        usleep(10);
    }
    return 0;
}


